package com.walker.kuyun.database.converter

import androidx.room.TypeConverter
import com.walker.kuyun.util.downloadanime.DownloadStatus

class DownloadStatusConverter {

    @TypeConverter
    fun intToEnum(status: Int?): DownloadStatus? = DownloadStatus.values()[status ?: 0]

    @TypeConverter
    fun enumToInt(downloadStatus: DownloadStatus?): Int? = downloadStatus?.ordinal

}